C++ language

FAQ
Previous Home Next
  1. Aren't templates glorified macros?
  2. If you know exceptions, aren't you worried that they could turn out to be the modern "goto"? Why isn't it that bad in C++?
  3. I would settle for "Why use const instead of #define?" as a question.
  4. What's the difference between a declaration and a definition?
  5. What's the difference between a struct and a class?
  6. Describe for me in 100 words or less how to simulate a virtual table using C.
  7. What is the difference between delete[] and delete?
  8. I need to write Wombat objects to an ostream. Describe two ways to accomplish this and one way that won't work.
  9. What's an initializer list?
  10. Can you think of a 5 letter word to describe the following?
  11. class { int n; public: void setN(int); int getN() const; }; (One possible answer: "struct"/cpp.)
  12. Describe how you extend stdio to access streams that the original implementation never heard of (socket stream, etc.).
  13. describe how you extend printf to support a new (user defined) type.
  14. What is Polymorphism
  15. What are the major differences between C and C++?
  16. What are the differences between new and malloc?
  17. What is the difference between delete and delete[]?
  18. What are the differences between a struct in C and in C++?
  19. What are the advantages/disadvantages of using #define?
  20. What are the advantages/disadvantages of using inline and const?
  21. What is the difference between a baller and a reference?
  22. When would you use a baller? A reference?
  23. What does it mean to take the address of a reference?
  24. What does it mean to declare a function or variable as static?
  25. What is the order of initalization for data?
  26. What is name mangling/name decoration?
  27. What kind of problems does name mangling cause?
  28. How do you work around them?
  29. What is a class?
  30. What are the differences between a struct and a class in C++?
  31. What is the difference between public, private, and protected access?
  32. For class CFoo { }; what default methods will the compiler generate for you>?
  33. How can you force the compiler to not generate them?
  34. What is the purpose of a constructor? Destructor?
  35. What is a constructor initializer list?
  36. When must you use a constructor initializer list?
  37. What is a:
    • Constructor?
    • Destructor?
    • Default constructor?
    • Copy constructor?
    • Conversion constructor?
  38. What does it mean to declare a/cpp.
    • member function as virtual?
    • member function as static?
    • member function as static?
    • member variable as static?
    • destructor as static?
  39. Can you explain the term "resource acquisition is initialization?"
  40. What is a "pure virtual" member function?
  41. What is the difference between public, private, and protected inheritance?
  42. What is virtual inheritance?
  43. What is placement new?
  44. What is the difference between operator new and the new operator?
  45. What is exception handling?
  46. Explain what happens when an exception is thrown in C++.
  47. What happens if an exception is not caught?
  48. What happens if an exception is throws from an object's constructor?
  49. What happens if an exception is throws from an object's destructor?
  50. What are the costs and benefits of using exceptions?
  51. When would you choose to return an error code rather than throw an exception?
  52. What is a template?
  53. What is partial specialization or template specialization?
  54. How can you force instantiation of a template?
  55. What is an iterator?
  56. What is an algorithm (in terms of the STL/C++ standard library)?
  57. What is std::auto_ptr?
  58. What is wrong with this statement? std::auto_ptr ptr(new char[10]);
Previous Home Next